<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Cheetah Software: CollisionBox&lt; T &gt; Class Template Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Cheetah Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="../../classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="../../inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="../../functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d1/db3/class_collision_box.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="../../d2/dac/class_collision_box-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">CollisionBox&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Inheritance diagram for CollisionBox&lt; T &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d2/df1/class_collision_box__inherit__graph.png" border="0" usemap="#_collision_box_3_01_t_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="_collision_box_3_01_t_01_4_inherit__map" id="_collision_box_3_01_t_01_4_inherit__map">
</map>
</div>
<div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Collaboration diagram for CollisionBox&lt; T &gt;:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d5/db8/class_collision_box__coll__graph.png" border="0" usemap="#_collision_box_3_01_t_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="_collision_box_3_01_t_01_4_coll__map" id="_collision_box_3_01_t_01_4_coll__map">
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae7ec1152381d81b7420a18ea13005465"><td class="memItemLeft" align="right" valign="top">EIGEN_MAKE_ALIGNED_OPERATOR_NEW&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/db3/class_collision_box.html#ae7ec1152381d81b7420a18ea13005465">CollisionBox</a> (const T &amp;mu, const T &amp;restitution, const T &amp;depth, const T &amp;width, const T &amp;height, const <a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt; &amp;position, const <a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt; &amp;ori)</td></tr>
<tr class="separator:ae7ec1152381d81b7420a18ea13005465"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef6487492c98f2dce452fe1250194e49"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/db3/class_collision_box.html#aef6487492c98f2dce452fe1250194e49">~CollisionBox</a> ()</td></tr>
<tr class="separator:aef6487492c98f2dce452fe1250194e49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8146ded7da878d256bfbff172cf96220"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/db3/class_collision_box.html#a8146ded7da878d256bfbff172cf96220">ContactDetection</a> (const <a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt; &amp;cp_pos, T &amp;penetration, <a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt; &amp;cp_frame)</td></tr>
<tr class="separator:a8146ded7da878d256bfbff172cf96220"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_collision"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_collision')"><img src="../../closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="../../df/dc6/class_collision.html">Collision&lt; T &gt;</a></td></tr>
<tr class="memitem:a2f6659233cb2931ce90a987b9c63febf inherit pub_methods_class_collision"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dc6/class_collision.html#a2f6659233cb2931ce90a987b9c63febf">Collision</a> (const T &amp;mu, const T &amp;resti)</td></tr>
<tr class="separator:a2f6659233cb2931ce90a987b9c63febf inherit pub_methods_class_collision"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a9711c3581d5ecdeccca21a90dc287a inherit pub_methods_class_collision"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dc6/class_collision.html#a4a9711c3581d5ecdeccca21a90dc287a">~Collision</a> ()</td></tr>
<tr class="separator:a4a9711c3581d5ecdeccca21a90dc287a inherit pub_methods_class_collision"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb697e7e67f1116b224d727ac1ac45ef inherit pub_methods_class_collision"><td class="memItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dc6/class_collision.html#adb697e7e67f1116b224d727ac1ac45ef">getFrictionCoeff</a> ()</td></tr>
<tr class="separator:adb697e7e67f1116b224d727ac1ac45ef inherit pub_methods_class_collision"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1aa86bac5c55155cfaba5792e92e6aec inherit pub_methods_class_collision"><td class="memItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dc6/class_collision.html#a1aa86bac5c55155cfaba5792e92e6aec">getRestitutionCoeff</a> ()</td></tr>
<tr class="separator:a1aa86bac5c55155cfaba5792e92e6aec inherit pub_methods_class_collision"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a16c886279dac5f69051384281f65cbf4"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a> [3]</td></tr>
<tr class="separator:a16c886279dac5f69051384281f65cbf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a974f96a1e563e75bc9d0dec03bd4ae32"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/db3/class_collision_box.html#a974f96a1e563e75bc9d0dec03bd4ae32">_position</a></td></tr>
<tr class="separator:a974f96a1e563e75bc9d0dec03bd4ae32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0bcc984dc2dbcd409b634e5858d1bd04"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a></td></tr>
<tr class="separator:a0bcc984dc2dbcd409b634e5858d1bd04"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_class_collision"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_collision')"><img src="../../closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="../../df/dc6/class_collision.html">Collision&lt; T &gt;</a></td></tr>
<tr class="memitem:a0566ee535b05726f8554b3a2de5f0201 inherit pro_attribs_class_collision"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dc6/class_collision.html#a0566ee535b05726f8554b3a2de5f0201">_mu</a></td></tr>
<tr class="separator:a0566ee535b05726f8554b3a2de5f0201 inherit pro_attribs_class_collision"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03de407f25b1ce69daf47fb6c10b83eb inherit pro_attribs_class_collision"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dc6/class_collision.html#a03de407f25b1ce69daf47fb6c10b83eb">_restitution_coeff</a></td></tr>
<tr class="separator:a03de407f25b1ce69daf47fb6c10b83eb inherit pro_attribs_class_collision"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br />
class CollisionBox&lt; T &gt;</h3>

<p>Class to represent box collision </p>

<p>Definition at line <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00017">17</a> of file <a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ae7ec1152381d81b7420a18ea13005465"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">EIGEN_MAKE_ALIGNED_OPERATOR_NEW <a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a>&lt; T &gt;::<a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a> </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>mu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>restitution</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>depth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>ori</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a new collision box </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mu</td><td>: coefficient of friction </td></tr>
    <tr><td class="paramname">restitution</td><td>: rebounding ratio (v+/v-) </td></tr>
    <tr><td class="paramname">depth</td><td>: depth of the box </td></tr>
    <tr><td class="paramname">width</td><td>: width of the box </td></tr>
    <tr><td class="paramname">height</td><td>: height of the box </td></tr>
    <tr><td class="paramname">position</td><td>: position of the box w.r.t the global frame </td></tr>
    <tr><td class="paramname">ori</td><td>: orientation of the box w.r.t the global frame </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00031">31</a> of file <a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>.</p>

<p>References <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00045">CollisionBox&lt; T &gt;::_size</a>.</p>
<div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;      : <a class="code" href="../../df/dc6/class_collision.html">Collision&lt;T&gt;</a>(mu, restitution), <a class="code" href="../../d1/db3/class_collision_box.html#a974f96a1e563e75bc9d0dec03bd4ae32">_position</a>(position), <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>(<a class="code" href="../../da/d9b/namespaceori.html">ori</a>) {</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <a class="code" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a>[0] = depth;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <a class="code" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a>[1] = width;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <a class="code" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a>[2] = height;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  }</div><div class="ttc" id="class_collision_box_html_a16c886279dac5f69051384281f65cbf4"><div class="ttname"><a href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">CollisionBox::_size</a></div><div class="ttdeci">T _size[3]</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/d8e/_collision_box_8h_source.html#l00045">CollisionBox.h:45</a></div></div>
<div class="ttc" id="class_collision_box_html_a974f96a1e563e75bc9d0dec03bd4ae32"><div class="ttname"><a href="../../d1/db3/class_collision_box.html#a974f96a1e563e75bc9d0dec03bd4ae32">CollisionBox::_position</a></div><div class="ttdeci">Vec3&lt; T &gt; _position</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/d8e/_collision_box_8h_source.html#l00047">CollisionBox.h:47</a></div></div>
<div class="ttc" id="class_collision_box_html_a0bcc984dc2dbcd409b634e5858d1bd04"><div class="ttname"><a href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">CollisionBox::_orientation</a></div><div class="ttdeci">Mat3&lt; T &gt; _orientation</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/d8e/_collision_box_8h_source.html#l00048">CollisionBox.h:48</a></div></div>
<div class="ttc" id="namespaceori_html"><div class="ttname"><a href="../../da/d9b/namespaceori.html">ori</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00028">orientation_tools.h:28</a></div></div>
<div class="ttc" id="class_collision_html"><div class="ttname"><a href="../../df/dc6/class_collision.html">Collision</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d87/_collision_8h_source.html#l00017">Collision.h:17</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aef6487492c98f2dce452fe1250194e49"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a>&lt; T &gt;::~<a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00040">40</a> of file <a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>.</p>

<p>References <a class="el" href="../../de/d7f/_collision_box_8cpp_source.html#l00010">CollisionBox&lt; T &gt;::ContactDetection()</a>.</p>
<div class="fragment"><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{}</div></div><!-- fragment -->
<p><div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-2-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d1/db3/class_collision_box_aef6487492c98f2dce452fe1250194e49_cgraph.png" border="0" usemap="#d1/db3/class_collision_box_aef6487492c98f2dce452fe1250194e49_cgraph" alt=""/></div>
<map name="d1/db3/class_collision_box_aef6487492c98f2dce452fe1250194e49_cgraph" id="d1/db3/class_collision_box_aef6487492c98f2dce452fe1250194e49_cgraph">
</map>
</div>
</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a8146ded7da878d256bfbff172cf96220"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a>&lt; T &gt;::ContactDetection </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>cp_pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T &amp;&#160;</td>
          <td class="paramname"><em>penetration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>cp_frame</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>check whether the contact happens or not cp_frame let you know which direction is normal (z) and which directions are x and y. The frame is basically contact coordinate w.r.t global. </p>

<p>Implements <a class="el" href="../../df/dc6/class_collision.html#addef60685c4386641fbc003cea00acbb">Collision&lt; T &gt;</a>.</p>

<p>Definition at line <a class="el" href="../../de/d7f/_collision_box_8cpp_source.html#l00010">10</a> of file <a class="el" href="../../de/d7f/_collision_box_8cpp_source.html">CollisionBox.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;                                                          {</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a> center2cp_local = <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.transpose() * (cp_pos - <a class="code" href="../../d1/db3/class_collision_box.html#a974f96a1e563e75bc9d0dec03bd4ae32">_position</a>);</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;  <span class="keywordtype">bool</span> inside_box(<span class="keyword">true</span>);</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;  T err[3] = {0};</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i(0); i &lt; 3; ++i) {</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <span class="comment">// Outside to the positive direction</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <span class="keywordflow">if</span> (center2cp_local[i] &gt; <a class="code" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a>[i] / 2.) {</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;      inside_box = <span class="keyword">false</span>;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    }</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="comment">// Outside to the negative direction</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (center2cp_local[i] &lt; -<a class="code" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a>[i] / 2.) {</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;      inside_box = <span class="keyword">false</span>;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    }</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="comment">// Distance from surface</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keywordflow">else</span> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;      err[i] = <a class="code" href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">_size</a>[i] / 2. - std::abs(center2cp_local[i]);</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    }</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  }</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  <span class="keywordflow">if</span> (inside_box) {</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">if</span> (err[2] &lt; std::min(err[0], err[1])) {  <span class="comment">// Contact on Z surface</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;      <span class="keywordflow">if</span> (center2cp_local[2] &gt; 0.) {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        cp_frame = <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;      } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        cp_frame = -<a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;      }</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;      penetration = -err[2];</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (err[1] &lt; std::min(err[0], err[2])) {  <span class="comment">// Contact on Y surface</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;      <span class="keywordflow">if</span> (center2cp_local[1] &gt; 0.) {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="comment">// X --&gt;X</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 0) =</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 0);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="comment">// -Z --&gt; Y</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 1) =</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            -<a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 2);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="comment">// Y --&gt; Z</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 2) =</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 1);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;      } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <span class="comment">// X --&gt; X</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 0) =</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 0);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="comment">// Z --&gt; Y</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 1) =</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 2);</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <span class="comment">// -Y --&gt; Z</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 2) =</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            -<a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 1);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;      }</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;      penetration = -err[1];</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    } <span class="keywordflow">else</span> {  <span class="comment">// contact on X surface</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;      <span class="keywordflow">if</span> (center2cp_local[0] &gt; 0.) {</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <span class="comment">// X --&gt;X</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 0) =</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 1);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="comment">// -Z --&gt; Y</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 1) =</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            -<a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 2);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="comment">// Y --&gt; Z</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 2) =</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 0);</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;      } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="comment">// X --&gt;X</span></div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 0) =</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 0);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="comment">// -Z --&gt; Y</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 1) =</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            <a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 1);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="comment">// Y --&gt; Z</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        cp_frame.template block&lt;3, 1&gt;(0, 2) =</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            -<a class="code" href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">_orientation</a>.template block&lt;3, 1&gt;(0, 0);</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      }</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      penetration = -err[0];</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    }</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;}</div><div class="ttc" id="class_collision_box_html_a16c886279dac5f69051384281f65cbf4"><div class="ttname"><a href="../../d1/db3/class_collision_box.html#a16c886279dac5f69051384281f65cbf4">CollisionBox::_size</a></div><div class="ttdeci">T _size[3]</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/d8e/_collision_box_8h_source.html#l00045">CollisionBox.h:45</a></div></div>
<div class="ttc" id="class_collision_box_html_a974f96a1e563e75bc9d0dec03bd4ae32"><div class="ttname"><a href="../../d1/db3/class_collision_box.html#a974f96a1e563e75bc9d0dec03bd4ae32">CollisionBox::_position</a></div><div class="ttdeci">Vec3&lt; T &gt; _position</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/d8e/_collision_box_8h_source.html#l00047">CollisionBox.h:47</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a6f07728c866b15ff0676a9b2ebfd2ba6"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 1 &gt; Vec3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00026">cppTypes.h:26</a></div></div>
<div class="ttc" id="class_collision_box_html_a0bcc984dc2dbcd409b634e5858d1bd04"><div class="ttname"><a href="../../d1/db3/class_collision_box.html#a0bcc984dc2dbcd409b634e5858d1bd04">CollisionBox::_orientation</a></div><div class="ttdeci">Mat3&lt; T &gt; _orientation</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/d8e/_collision_box_8h_source.html#l00048">CollisionBox.h:48</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-3" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-3-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-3-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-3-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d1/db3/class_collision_box_a8146ded7da878d256bfbff172cf96220_icgraph.png" border="0" usemap="#d1/db3/class_collision_box_a8146ded7da878d256bfbff172cf96220_icgraph" alt=""/></div>
<map name="d1/db3/class_collision_box_a8146ded7da878d256bfbff172cf96220_icgraph" id="d1/db3/class_collision_box_a8146ded7da878d256bfbff172cf96220_icgraph">
</map>
</div>
</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a0bcc984dc2dbcd409b634e5858d1bd04"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt;T&gt; <a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a>&lt; T &gt;::_orientation</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00048">48</a> of file <a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>.</p>

</div>
</div>
<a class="anchor" id="a974f96a1e563e75bc9d0dec03bd4ae32"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt;T&gt; <a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a>&lt; T &gt;::_position</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00047">47</a> of file <a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>.</p>

</div>
</div>
<a class="anchor" id="a16c886279dac5f69051384281f65cbf4"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T <a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a>&lt; T &gt;::_size[3]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../dc/d8e/_collision_box_8h_source.html#l00045">45</a> of file <a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="../../dc/d8e/_collision_box_8h_source.html">CollisionBox.h</a></li>
<li><a class="el" href="../../de/d7f/_collision_box_8cpp_source.html">CollisionBox.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d1/db3/class_collision_box.html">CollisionBox</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
